<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../js/jquery-3.5.1.min.js"></script>
    <script>
        $(document).ready(function () {
            $("tbody>tr:even").css("backgroundColor","#a29164");
            $("tbody>tr:odd").css("backgroundColor","#89639b");
        })
        function delEmp(empNo) {
            if (confirm("你确定要要删除么？")){
                location.href="del.jsp?empNo="+empNo;
            }
        }
    </script>
</head>
<body>
    <c:if test="${empty ALL_EMP_LIST}">
        <c:redirect url="get.jsp?page=1"/>
    </c:if>
    <table border="1" align="center" width="80%">
        <thead>
            <tr style="background-color: #8d4004;color: #ffffff">
                <th>序号</th>
                <th>姓名</th>
                <th>职位</th>
                <th>上司</th>
                <th>入职时间</th>
                <th>工资</th>
                <th>奖金</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach var="emp" items="${ALL_EMP_LIST}" varStatus="j">
                <tr>
                    <td>${j.count}</td>
                    <td>${emp.ename}</td>
                    <td>${emp.job}</td>
                    <td>${emp.mgr}</td>
                    <td>${emp.hireDate}</td>
                    <td>${emp.sal}</td>
                    <td>${emp.comm}</td>
                    <td>
                       <a href="javascript:delEmp(${emp.empNo})">删除</a>
                        修改
                    </td>
                </tr>
            </c:forEach>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="8" align="center">
                    <c:forEach var="i" begin="1" end="${PAGE_NUM}" step="1">
                        <a href="get.jsp?page=${i}">${i}</a>&nbsp;
                    </c:forEach>
                </td>
            </tr>
        </tfoot>
    </table>
</body>
</html>
